def IntegerRange( minV, maxV ):
  def f(x):
    try:
      x = int(x)
    except:
      return (False,"Value must be an integer between %d and %d." % (minV,maxV))
      
    if x <= maxV and x >= minV:
      return (True,x)
    else:
      return (False,"Value must an integer be between %d and %d." % (minV,maxV))
  return f
